﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BioAttendance
{
    public partial class MainPageAdmin : Form
    {
        private BioAttendanceEntities DbEntities;        

        public MainPageAdmin()
        {
            InitializeComponent();
            this.DbEntities = new BioAttendanceEntities();
            this.FormClosed += new FormClosedEventHandler(BioAttendanceMainPage_FormClosed);
        }

        private void registerNewEmployeeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (RegistrationPage empRegForm = new RegistrationPage(this.DbEntities))
            {
                empRegForm.ShowDialog();
            }
        }

        private void employeeListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (EmpListForm empListForm = new EmpListForm(this.DbEntities))
            {
                empListForm.ShowDialog();
            }
        }

        private void BioAttendanceMainPage_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.DbEntities.Dispose();
        }

        private void employeeCategoryListToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (HelpForm helpForm = new HelpForm())
            {
                helpForm.ShowDialog();
            }
        }

        private void buttonEmpEntry_Click(object sender, EventArgs e)
        {
            using (VerificationForm empVerificationForm = new VerificationForm(this.DbEntities))
            {
                empVerificationForm.ShowDialog();
            }
        }
    }
}
